﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;

namespace PropertyAppraisal.Auditing
{
    public partial class ShengHePager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        /// <summary>
        /// 审核通过
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public static int submins(string ProjectNumber, string Auditing_Opinion, string auditing_Type)
        {

            EAAuditing au = new EAAuditing();
            au.ProjectNumber = ProjectNumber;
            au.auditing_CreatePeople = "11";
            au.auditing_CreateTime = DateTime.Now.Date;
            au.Auditing_Opinion = Auditing_Opinion;
            au.auditing_Time = DateTime.Now.Date;
            au.auditing_Type = auditing_Type;
            BLL.AuditingBll bll = new BLL.AuditingBll();
            if (auditing_Type == "初审")
            {
                new BLL.Basic_InfoBll().UpdateState(7, au.ProjectNumber);
            }
            if (auditing_Type == "终审")
            {
                new BLL.Basic_InfoBll().UpdateState(9, au.ProjectNumber);
            }
            var result = bll.AuAdd(au);
            if (result)
            {
                return 1;
            }
            else
                return 0;

        }
        /// <summary>
        /// 审核不通过
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public static int submins2(string ProjectNumber, string Auditing_Opinion, string auditing_Type)
        {

            EAAuditing au = new EAAuditing();
            au.ProjectNumber = ProjectNumber;
            au.auditing_CreatePeople = "11";
            au.auditing_CreateTime = DateTime.Now.Date;
            au.Auditing_Opinion = Auditing_Opinion;
            au.auditing_Time = DateTime.Now.Date;
            au.auditing_Type = auditing_Type;
            BLL.AuditingBll bll = new BLL.AuditingBll();
            if (auditing_Type == "初审")
            {
                new BLL.Basic_InfoBll().UpdateState(6, au.ProjectNumber);
            }
            if (auditing_Type == "终审")
            {
                new BLL.Basic_InfoBll().UpdateState(8, au.ProjectNumber);
            }
            var result = bll.AuAdd(au);
            if (result)
            {
                return 1;
            }
            else
                return 0;

        }
    }
}